<template>
  <div id="wrapper">
    <main>
      <div class="right-side">
        <div class="doc">
          <div class="title alt">{{ $t("buttonTips") }}</div>
        </div>
        <div class="doc">

          <el-button type="primary" round @click="powerMonitor">{{$t("device.powerMonitor")}}</el-button>
          <el-button type="primary" round @click="screen(0)">{{$t("device.screen")}}</el-button>

        </div>
      </div>
    </main>
  </div>
</template>

<script>

const logger  = require('@/utils/electron/index').Logger('device')
export default {
  name: "Device",

  data: () => ({

  }),
  created() {
      this.$ipc.on('rendererPowerMonitor',(event,response) => {
          logger.info('接受到main消息',response)
      })

  },
  methods: {
   powerMonitor(){
       let that = this
       that.$ipc.send('powerMonitor')
   },
   screen(arg){
       let that = this
     const screenInfo =   that.$ipc.callMain('getScreen', arg);
      logger.info('接受到main消息',screenInfo)
   }
  }
};
</script>

<style>
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Source Sans Pro", sans-serif;
}

#wrapper {
  padding: 60px 80px;
}

#logo {
  height: auto;
  margin-bottom: 20px;
  width: 420px;
}

main {
  display: flex;
  justify-content: space-between;
}

main > div {
  flex-basis: 50%;
}

.left-side {
  display: flex;
  flex-direction: column;
}

.welcome {
  color: #555;
  font-size: 23px;
  margin-bottom: 10px;
}

.title {
  color: #2c3e50;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 6px;
}

.title.alt {
  font-size: 18px;
  margin-bottom: 10px;
}
.doc {
  margin-bottom: 10px;
}
.doc p {
  color: black;
  margin-bottom: 10px;
}
.doc .el-button {
  margin-top: 10px;
  margin-right: 10px;
}
.doc .el-button + .el-button {
  margin-left: 0;
}
.conten {
  text-align: center;
}
</style>
